import React, { Component } from 'react';
import UserSearch from './components/UserSearch';
import UserTable from './components/UserTable';
import axios from 'axios';
import cookie from 'react-cookies';

export default class UserManagement extends Component {
  static displayName = 'UserManagement';
  constructor(props) {
    super(props);
    this.state = {};
  }
  componentDidMount() {
    const baseurl = 'http://39.105.21.199:8989/IPEvaluation/evaluateManage/userShowEvaluateList.do?sessionId=';
    const sessionid = cookie.load('sessionId');
    axios.post(baseurl + sessionid).then((response) => {
      const msg = response.data.msg;
      if (msg === 'LoginInvalidate') {
        this.props.history.push('/pagelogin');
      }
    }).catch((error) => {
      console.log(error);
    });
  }

  render() {
    return (
      <div>

        <UserTable />
      </div>
    );
  }
}
